package it.gtd.swimpool.controller.mapper;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

@Provider
public class NullPointerExceptionMapper implements ExceptionMapper<NullPointerException> {
    @Override
    public Response toResponse(NullPointerException throwable) {
        return Response.status(Response.Status.PRECONDITION_FAILED).entity(throwable.getMessage()).build();
    }
}
